-- GENERATED SPELL FOR [Troll Roof Stalker] --


function spell0_23090(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23090', 10305, 1)
end

function spell1_23090(pUnit, Event) --@Net,n/a--
pUnit:FullCastSpellOnTarget(6533,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23090', 2277, 1)
end

function spell2_23090(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(40124,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23090', 601, 1)
end

function spell3_23090(pUnit, Event) --@Stealth,Self--
pUnit:FullCastSpellOnTarget(30991,pUnit)
pUnit:RegisterEvent('Sorts_23090', 0, 1)
end

function Sorts_23090(pUnit, Event)
local choix_sorts_23090 = math.random(0, 3)
if choix_sorts_23090 == 0 then
pUnit:RegisterEvent('spell0_23090', 1, 1)
end
if choix_sorts_23090 == 1 then
pUnit:RegisterEvent('spell1_23090', 1, 1)
end
if choix_sorts_23090 == 2 then
pUnit:RegisterEvent('spell2_23090', 1, 1)
end
if choix_sorts_23090 == 3 then
pUnit:RegisterEvent('spell3_23090', 1, 1)
end
end

function mob23090_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23090', math.random(1500, 3000), 1)
end

function mob23090_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23090_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23090_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23090, 1, 'mob23090_Action')
RegisterUnitEvent(23090, 2, 'mob23090_Leave')
RegisterUnitEvent(23090, 3, 'mob23090_Kill')
RegisterUnitEvent(23090, 4, 'mob23090_Die')
